﻿<Window x:Class="SEToolbox.Views.WindowFindApplication"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:commands="clr-namespace:SEToolbox.Services"
        xmlns:converters="clr-namespace:SEToolbox.Converters"
        xmlns:lex="http://wpflocalizeextension.codeplex.com"
        lex:LocalizeDictionary.DesignCulture="en"
        lex:ResxLocalizationProvider.DefaultAssembly="SEToolbox"
        lex:ResxLocalizationProvider.DefaultDictionary="Resources"
        Height="200" Width="400" ResizeMode="NoResize" Title="{lex:Loc WnLocateAppTitle}"
        WindowStartupLocation="CenterScreen" Icon="/SEToolbox;component/app.ico"
        commands:DialogCloser.DialogResult="{Binding CloseResult}"
        commands:DialogService.IsRegisteredView="True"
        FocusManager.FocusedElement="{Binding ElementName=uxInitialElement}">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <converters:ResouceToImageConverter x:Key="ResouceToImageConverter"/>
    </Window.Resources>
    <Grid IsEnabled="{Binding IsActive}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Image Width="32" Height="32" Source="{Binding Converter={StaticResource ResouceToImageConverter}, ConverterParameter=warning32}" VerticalAlignment="Top" Margin="0,16,0,0" />
            <Grid Grid.Row="0" Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" TextWrapping="Wrap" Margin="0,8,0,8" Text="{lex:Loc WnLocateAppPromptUser}"/>
                <StackPanel Orientation="Horizontal" Grid.Row="1">
                    <TextBox Width="280" Text="{Binding GameApplicationPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Name="uxInitialElement"/>
                    <Button ToolTip="{lex:Loc BtBrowseAppTip}" Command="{Binding BrowseApplicationCommand}" VerticalAlignment="Center">
                        <Image Width="16" Height="16" Source="{Binding Converter={StaticResource ResouceToImageConverter}, ConverterParameter=folder}" />
                    </Button>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,8,0,0" Visibility="{Binding IsValidApplication, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Image Width="24" Height="24" Source="{Binding Converter={StaticResource ResouceToImageConverter}, ConverterParameter=check24}" VerticalAlignment="Center"/>
                    <TextBlock Text="{lex:Loc WnLocateAppValidText}" VerticalAlignment="Center" Margin="8,0,0,0"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,8,0,0" Visibility="{Binding IsWrongApplication, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Image Width="24" Height="24" Source="{Binding Converter={StaticResource ResouceToImageConverter}, ConverterParameter=error24}" VerticalAlignment="Center"/>
                    <TextBlock Text="{lex:Loc WnLocateAppInvalidText}" VerticalAlignment="Center" Margin="8,0,0,0"/>
                </StackPanel>
            </Grid>
            <StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,8,8,8">
                <Button Width="90" Command="{Binding ContinueCommand}" Content="{lex:Loc BtContinue}" IsDefault="True"/>
                <Button Margin="8,0,0,0" Width="90" Command="{Binding CancelCommand}" Content="{lex:Loc BtCancel}" IsCancel="True"/>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
